<%@page contentType="text/html" pageEncoding="ISO-8859-1"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@taglib prefix="t" uri="http://myfaces.apache.org/tomahawk"%>
<%@taglib uri="http://richfaces.org/rich" prefix="rich"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<f:view>
    <%@include file="../jspf/html_inicio.jspf" %>
    <%@include file="../jspf/menu_principal.jspf" %>


    <span class="titulo"><h:outputText style= "margin-left:20px" value="Reporte Inscritos por Eventos" /></span>

    <t:div>

        <h:form>
            <a4j:outputPanel ajaxRendered="true">
                <h:messages id="lblMessages" styleClass="messages" infoClass="infoClass" errorClass="errorClass"
                            warnClass="warnClass" showDetail="true" errorStyle="color:red;"
                            warnStyle="color:green;" infoStyle="color:black;" fatalStyle="color:black"/>
            </a4j:outputPanel>
            <h:panelGrid columns="2">
                <h:outputText value="Evento" />
                <h:selectOneMenu style= "font-size: 10px;" value="#{ReporteAsistentesController.eventoSeleccionado}" >
                    <f:selectItems value="#{EventoController.comboEventos}" />
                    <a4j:support event="onchange"  reRender="dtTable,table1,ds" action="#{ReporteAsistentesController.recalcularCombo}" ajaxSingle="true" />
                </h:selectOneMenu>
            </h:panelGrid>
            <br/>
            <br/>
            <h:panelGrid  id="dtTable" columns="2">
                <h:outputLabel value="Nro Inscritos:" />
                <h:outputText value="#{ReporteAsistentesController.cantidad}" />
            </h:panelGrid>
            <br/>
            <br/>
            <rich:dataTable  style= "margin-left:40px;font-size: 10px;" id="table1" value="#{ReporteAsistentesController.listaReportes}" var="item"
            rows="10" reRender="ds" width="500px">
                <f:facet name="header">
                    <h:outputText value="Lista de Inscritos Por Evento"/>
                </f:facet>
                <rich:column sortBy="#{item.nroCIP}" width="80px">
                    <f:facet name="header">
                        <h:outputText value="Nro CIP"/>
                    </f:facet>
                    <h:outputText value="#{item.nroCIP}"/>
                </rich:column>
                <rich:column sortBy="#{item.participante}" width="220px">
                    <f:facet name="header">
                        <h:outputText value="Participante"/>
                    </f:facet>
                    <h:outputText value="#{item.participante}"/>
                </rich:column>
                <rich:column sortBy="#{item.especialidad}" width="100px">
                    <f:facet name="header">
                        <h:outputText value="Especialidad"/>
                    </f:facet>
                    <h:outputText value="#{item.especialidad}"/>
                </rich:column>
                <rich:column sortBy="#{item.capitulo}" width="100px">
                    <f:facet name="header">
                        <h:outputText value="Capitulo"/>
                    </f:facet>
                    <h:outputText value="#{item.capitulo}"/>
                </rich:column>
                <f:facet name="footer">
                    <rich:datascroller id="ds"></rich:datascroller>
                </f:facet>
            </rich:dataTable>
            
            <br/>
            <br/>
            <h:panelGrid columns="3">
                <h:commandButton style="font-weight: bold; margin-left:150px; margin-right: auto;" value="PDF" action="#{ReporteAsistentesController.ReporteInscritosPDF}" image="/img/pdf.png" title="Exportar a pdf" />
                <h:commandButton style="font-weight: bold; margin-left:70px; margin-right: auto;" value="Excel" action="#{ReporteAsistentesController.ReporteInscritosExcel}" image="/img/excel.png"/>
                <h:commandButton style="font-weight: bold; margin-left:70px; margin-right: auto;" value="Word" action="#{ReporteAsistentesController.ReporteInscritosWord}" image="/img/word.png"/>
            </h:panelGrid>

        </h:form>
    </t:div>
    <%@include file="../jspf/pie.jspf" %>

</f:view>


